<template>
  <div class="portal">
    <div class="card">
      <div class="avatar">
        <img :src="userinfo?.avatar" alt="" />
      </div>
      <div class="right">
        <div class="name">{{ getTime() }}！ {{ userinfo?.username }}</div>
        <div class="desc">{{ userinfo?.desc }}</div>
      </div>
    </div>
    <div class="buttom">
      <img src="@/assets/icons/welcome.svg" alt="" />
    </div>
  </div>
</template>

<script lang="ts" setup>
import useUserStore from '@/stores/user'
import { ref } from 'vue'
import getTime from '@/utils/getTime'
const userStore = useUserStore()
const userinfo = ref(null)
userinfo.value = userStore.userinfo

const time = getTime()
console.log(userinfo.value, 'userinfo', time)

//获取当前时间
</script>

<style lang="scss" scoped>
.portal {
  width: 100%;
  height: 100%;
  padding: 50px 20px;
  .card {
    width: 100%;
    height: 200px;
    border: 1px solid #f5f5ff;
    box-shadow: 0 0 10px #ccc;
    display: flex;
    align-items: center;
    cursor: pointer;
    .avatar {
      width: 80px;
      height: 80px;
      margin-left: 10px;
      & > img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
    }
    .right {
      flex: 1;
      padding-left: 10px;
      .name {
        font-size: 20px;
        font-weight: 600;
      }
      .desc {
        font-size: 16px;
        color: #999;
        margin-top: 25px;
      }
    }
  }
  .buttom {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 50px;
    & > img {
      width: auto;
      height: 200px;
      object-fit: cover;
    }
  }
}
</style>
